package com.liujun.spring4.demo.aop.iocset.xmlset.functionLookup;

import org.springframework.beans.factory.support.MethodReplacer;

import java.lang.reflect.Method;

/**
 * @author liujun
 * @version 1.0
 * @date 2018-08-17 10:38:00
 */
public class BossReplacer implements MethodReplacer {
  @Override
  public Object reimplement(Object obj, Method method, Object[] args) throws Throwable {

    // Car carOld = (Car) method.invoke(obj, args);

    System.out.println(obj);

    Car car = new Car();
    car.setBrand("宝马M5");
    car.setPrice(2800000);
    car.setMaxSpeed(380);
    return car;
  }
}
